{extend name="user-layout" /}
{block name="content"}
<div class="content-wrapper">
    <div class="row">
        <div class="col-lg-12 grid-margin stretch-card">
            <div class="card">
                <div class="card-body">
                    <h4 class="card-title">下级商户</h4>
                    <p class="card-description">
                        在这里可以浏览你得所有下级商户
                    </p>
                    <form class="forms-sample" action="" method="get">
                        <div class="form-group row">
                            <div class="form-group col-xl-4">
                                <label>商户UID:</label>
                                <input type="text" name="trade_no" class="form-control" value="{$Request.get.trade_no}" placeholder="请输入订单号" >
                            </div>
                            <div class="form-group col-xl-4">
                                <label>开始时间:</label>
                                <div id="datepicker-order-start" class="input-group date datepicker">
                                    <input type="text" name="d[start]" value="{$Request.get.d.start}" placeholder="Y-m-d h:i:s" class="form-control">
                                    <span class="input-group-addon input-group-append border-left">
                                      <span class="icon-calendar input-group-text"></span>
                                    </span>
                                </div>
                            </div>
                            <div class="form-group col-xl-4">
                                <label>结束时间:</label>
                                <div id="datepicker-order-end" class="input-group date datepicker">
                                    <input type="text" name="d[end]" value="{$Request.get.d.end}" placeholder="Y-m-d h:i:s" class="form-control">
                                    <span class="input-group-addon input-group-append border-left">
                                      <span class="icon-calendar input-group-text"></span>
                                    </span>
                                </div>
                            </div>
                            <div class="form-group col-xl-4">
                                <label>商户状态</label>
                                <select name="status" class="form-control">
                                    <option value="">请选择一个状态</option>
                                    <option {$Request.get.status == '0' ? 'selected' : '' } value="0">关闭订单</option>
                                    <option {$Request.get.status == '1' ? 'selected' : '' } value="1">等待支付</option>
                                    <option {$Request.get.status == '2' ? 'selected' : '' } value="2">支付成功</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <button type="submit" class="btn btn-primary btn-submit-orderlist btn-fw">搜索</button>
                        </div>
                    </form>
                    <p class="card-description">
                        <a href="{:url('index/Agent/addUser')}" class="btn btn-primary btn-fw">新增账户</a>
                    </p>
                    <div class="table-responsive">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th>商户UID</th>
                                <th>商户邮箱</th>
                                <th>商户名称</th>
                                <th>联系手机</th>
                                <th>认证状态</th>
                                <th class="text-center">更新时间</th>
                                <th class="text-center">状态</th>
                                <th class="text-center">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr>
                                <td><div class="disc bg-secondary"></div></td>
                                <td>{$vo.uid}</td>
                                <td>{$vo.account}</td>
                                <td>{$vo.username}</td>
                                <td>{$vo.phone}</td>
                                <td>
                                    {switch $vo.is_verify}
                                    {case 0}<label class="badge badge-dark">未验证</label>{/case}
                                    {case 1}<label class="badge badge-success">已验证</label>{/case}
                                    {default}<label class="badge badge-info">异常</label>{/case}
                                    {/switch}</td>
                                <td class="text-center">{$vo.update_time|date='Y/m/d H:i:s',###}</td>
                                <td class="text-center">
                                    {switch $vo.status}
                                    {case 0}<label class="badge badge-dark">商户禁用</label>{/case}
                                    {case 1}<label class="badge badge-success">商户正常</label>{/case}
                                    {default}<label class="badge badge-info">异常商户</label>{/case}
                                    {/switch}
                                </td>
                                <td class="text-center">
                                    <a href="{:url('index/Agent/profit')}?uid={$vo.uid}" class="btn btn-warning btn-fw">分润</a>
                                    <a href="{:url('index/Agent/editUser')}?uid={$vo.uid}" class="btn btn-primary btn-fw">编辑</a>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </div>
                    {$list->render()}
                    {empty name="list"}
                    <div class="card" id="context-menu-multi">
                        <div class="card-body">
                            <p class="card-text text-center text-danger">
                                <i class="icon-compass"></i>
                                暂无数据...
                            </p>
                        </div>
                    </div>
                    {/empty}
                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="pagejs"}
<script src="__STATIC__/cloudui/js/formpickers.js"></script>
{/block}